<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
*{margin:0;padding:0;}

</style>
</head>

<body>
	<script>
    	var textNode=document.createTextNode('<strong>Hello</strong>world');
		
		var anotherTextNode=document.createTextNode('<span>8888888888</span>');
		
		var element=document.createElement('div');
		
		element.className='message';
		
		element.appendChild(textNode);
		
		element.appendChild(anotherTextNode);
		
		document.body.appendChild(element);
		
		console.log(element.childNodes.length);//2
		
		element.normalize();
		//IE8-
		console.log(element.childNodes.length);//1
		
		console.log(element.firstChild.nodeValue);//<strong>Hello</strong>world<span>8888888888</span>
		
    </script>
    
</body>
</html>
